package cn.zxh.csdn_maven.work.flow.download;

import java.util.Map;

import org.apache.http.client.HttpClient;

import cn.zxh.csdn_maven.work.flow.download.chains.FirstUrlFlow;
import cn.zxh.csdn_maven.work.flow.download.chains.SecondUrlFlow;

/**
 * 
 * @author zhangxinhua
 *
 */
@SuppressWarnings(value={"unused"})
public class WorkFlowde {
	/**单例*/
	private static WorkFlowde workFlowde = new WorkFlowde();
	private IFlowController startFlow;
	private WorkFlowde(){
		/**初始化工作流*/
		startFlow=new FirstUrlFlow();
		IFlowController secondFlow = startFlow.setNextFlow(new SecondUrlFlow());
	}
	public static WorkFlowde getInstance()
	{
		return workFlowde;
	}

	public Map<String, Object> startExec(HttpClient client,Map<String, Object> params) throws Exception
	{
		return this.startFlow.run(client,params);
	}
}
